// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod managed_schema_registry {
    use crate::Result;

    /// A builder for [ManagedSchemaRegistry][crate::client::ManagedSchemaRegistry].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_managedkafka_schemaregistry_v1::*;
    /// # use builder::managed_schema_registry::ClientBuilder;
    /// # use client::ManagedSchemaRegistry;
    /// let builder : ClientBuilder = ManagedSchemaRegistry::builder();
    /// let client = builder
    ///     .with_endpoint("https://managedkafka.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::ManagedSchemaRegistry;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = ManagedSchemaRegistry;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::ManagedSchemaRegistry] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_schema_registry][crate::client::ManagedSchemaRegistry::get_schema_registry] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetSchemaRegistry;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSchemaRegistry {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSchemaRegistry(RequestBuilder<crate::model::GetSchemaRegistryRequest>);

    impl GetSchemaRegistry {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetSchemaRegistryRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaRegistry> {
            (*self.0.stub)
                .get_schema_registry(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetSchemaRegistryRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetSchemaRegistry {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_schema_registries][crate::client::ManagedSchemaRegistry::list_schema_registries] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListSchemaRegistries;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSchemaRegistries {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSchemaRegistries(RequestBuilder<crate::model::ListSchemaRegistriesRequest>);

    impl ListSchemaRegistries {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListSchemaRegistriesRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListSchemaRegistriesResponse> {
            (*self.0.stub)
                .list_schema_registries(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListSchemaRegistriesRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSchemaRegistries {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::create_schema_registry][crate::client::ManagedSchemaRegistry::create_schema_registry] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::CreateSchemaRegistry;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateSchemaRegistry {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateSchemaRegistry(RequestBuilder<crate::model::CreateSchemaRegistryRequest>);

    impl CreateSchemaRegistry {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateSchemaRegistryRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaRegistry> {
            (*self.0.stub)
                .create_schema_registry(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateSchemaRegistryRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [schema_registry_id][crate::model::CreateSchemaRegistryRequest::schema_registry_id].
        ///
        /// This is a **required** field for requests.
        pub fn set_schema_registry_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.schema_registry_id = v.into();
            self
        }

        /// Sets the value of [schema_registry][crate::model::CreateSchemaRegistryRequest::schema_registry].
        ///
        /// This is a **required** field for requests.
        pub fn set_schema_registry<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SchemaRegistry>,
        {
            self.0.request.schema_registry = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [schema_registry][crate::model::CreateSchemaRegistryRequest::schema_registry].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_schema_registry<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SchemaRegistry>,
        {
            self.0.request.schema_registry = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateSchemaRegistry {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::delete_schema_registry][crate::client::ManagedSchemaRegistry::delete_schema_registry] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::DeleteSchemaRegistry;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteSchemaRegistry {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteSchemaRegistry(RequestBuilder<crate::model::DeleteSchemaRegistryRequest>);

    impl DeleteSchemaRegistry {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteSchemaRegistryRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_schema_registry(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteSchemaRegistryRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteSchemaRegistry {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_context][crate::client::ManagedSchemaRegistry::get_context] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetContext;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetContext {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetContext(RequestBuilder<crate::model::GetContextRequest>);

    impl GetContext {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetContextRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Context> {
            (*self.0.stub)
                .get_context(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetContextRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetContext {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_contexts][crate::client::ManagedSchemaRegistry::list_contexts] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListContexts;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListContexts {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListContexts(RequestBuilder<crate::model::ListContextsRequest>);

    impl ListContexts {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListContextsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .list_contexts(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListContextsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListContexts {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_schema][crate::client::ManagedSchemaRegistry::get_schema] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetSchema;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSchema {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSchema(RequestBuilder<crate::model::GetSchemaRequest>);

    impl GetSchema {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetSchemaRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Schema> {
            (*self.0.stub)
                .get_schema(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetSchemaRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [subject][crate::model::GetSchemaRequest::subject].
        pub fn set_subject<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [subject][crate::model::GetSchemaRequest::subject].
        pub fn set_or_clear_subject<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetSchema {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_raw_schema][crate::client::ManagedSchemaRegistry::get_raw_schema] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetRawSchema;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetRawSchema {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetRawSchema(RequestBuilder<crate::model::GetSchemaRequest>);

    impl GetRawSchema {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetSchemaRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .get_raw_schema(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetSchemaRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [subject][crate::model::GetSchemaRequest::subject].
        pub fn set_subject<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [subject][crate::model::GetSchemaRequest::subject].
        pub fn set_or_clear_subject<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetRawSchema {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_schema_versions][crate::client::ManagedSchemaRegistry::list_schema_versions] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListSchemaVersions;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSchemaVersions {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSchemaVersions(RequestBuilder<crate::model::ListSchemaVersionsRequest>);

    impl ListSchemaVersions {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListSchemaVersionsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .list_schema_versions(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListSchemaVersionsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [subject][crate::model::ListSchemaVersionsRequest::subject].
        pub fn set_subject<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [subject][crate::model::ListSchemaVersionsRequest::subject].
        pub fn set_or_clear_subject<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject = v.map(|x| x.into());
            self
        }

        /// Sets the value of [deleted][crate::model::ListSchemaVersionsRequest::deleted].
        pub fn set_deleted<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [deleted][crate::model::ListSchemaVersionsRequest::deleted].
        pub fn set_or_clear_deleted<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSchemaVersions {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_schema_types][crate::client::ManagedSchemaRegistry::list_schema_types] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListSchemaTypes;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSchemaTypes {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSchemaTypes(RequestBuilder<crate::model::ListSchemaTypesRequest>);

    impl ListSchemaTypes {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListSchemaTypesRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .list_schema_types(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListSchemaTypesRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSchemaTypes {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_subjects][crate::client::ManagedSchemaRegistry::list_subjects] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListSubjects;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSubjects {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSubjects(RequestBuilder<crate::model::ListSubjectsRequest>);

    impl ListSubjects {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListSubjectsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .list_subjects(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListSubjectsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [subject_prefix][crate::model::ListSubjectsRequest::subject_prefix].
        pub fn set_subject_prefix<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject_prefix = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [subject_prefix][crate::model::ListSubjectsRequest::subject_prefix].
        pub fn set_or_clear_subject_prefix<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject_prefix = v.map(|x| x.into());
            self
        }

        /// Sets the value of [deleted][crate::model::ListSubjectsRequest::deleted].
        pub fn set_deleted<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [deleted][crate::model::ListSubjectsRequest::deleted].
        pub fn set_or_clear_deleted<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSubjects {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_subjects_by_schema_id][crate::client::ManagedSchemaRegistry::list_subjects_by_schema_id] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListSubjectsBySchemaId;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSubjectsBySchemaId {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSubjectsBySchemaId(RequestBuilder<crate::model::ListSubjectsBySchemaIdRequest>);

    impl ListSubjectsBySchemaId {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListSubjectsBySchemaIdRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .list_subjects_by_schema_id(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListSubjectsBySchemaIdRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [subject][crate::model::ListSubjectsBySchemaIdRequest::subject].
        pub fn set_subject<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [subject][crate::model::ListSubjectsBySchemaIdRequest::subject].
        pub fn set_or_clear_subject<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.subject = v.map(|x| x.into());
            self
        }

        /// Sets the value of [deleted][crate::model::ListSubjectsBySchemaIdRequest::deleted].
        pub fn set_deleted<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [deleted][crate::model::ListSubjectsBySchemaIdRequest::deleted].
        pub fn set_or_clear_deleted<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSubjectsBySchemaId {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::delete_subject][crate::client::ManagedSchemaRegistry::delete_subject] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::DeleteSubject;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteSubject {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteSubject(RequestBuilder<crate::model::DeleteSubjectRequest>);

    impl DeleteSubject {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteSubjectRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .delete_subject(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteSubjectRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [permanent][crate::model::DeleteSubjectRequest::permanent].
        pub fn set_permanent<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.permanent = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [permanent][crate::model::DeleteSubjectRequest::permanent].
        pub fn set_or_clear_permanent<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.permanent = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteSubject {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::lookup_version][crate::client::ManagedSchemaRegistry::lookup_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::LookupVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> LookupVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct LookupVersion(RequestBuilder<crate::model::LookupVersionRequest>);

    impl LookupVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::LookupVersionRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaVersion> {
            (*self.0.stub)
                .lookup_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::LookupVersionRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [schema_type][crate::model::LookupVersionRequest::schema_type].
        pub fn set_schema_type<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::schema::SchemaType>,
        {
            self.0.request.schema_type = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [schema_type][crate::model::LookupVersionRequest::schema_type].
        pub fn set_or_clear_schema_type<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::schema::SchemaType>,
        {
            self.0.request.schema_type = v.map(|x| x.into());
            self
        }

        /// Sets the value of [schema][crate::model::LookupVersionRequest::schema].
        ///
        /// This is a **required** field for requests.
        pub fn set_schema<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.schema = v.into();
            self
        }

        /// Sets the value of [references][crate::model::LookupVersionRequest::references].
        pub fn set_references<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::schema::SchemaReference>,
        {
            use std::iter::Iterator;
            self.0.request.references = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [normalize][crate::model::LookupVersionRequest::normalize].
        pub fn set_normalize<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.normalize = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [normalize][crate::model::LookupVersionRequest::normalize].
        pub fn set_or_clear_normalize<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.normalize = v.map(|x| x.into());
            self
        }

        /// Sets the value of [deleted][crate::model::LookupVersionRequest::deleted].
        pub fn set_deleted<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [deleted][crate::model::LookupVersionRequest::deleted].
        pub fn set_or_clear_deleted<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for LookupVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_version][crate::client::ManagedSchemaRegistry::get_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);

    impl GetVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaVersion> {
            (*self.0.stub)
                .get_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetVersionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [deleted][crate::model::GetVersionRequest::deleted].
        pub fn set_deleted<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [deleted][crate::model::GetVersionRequest::deleted].
        pub fn set_or_clear_deleted<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_raw_schema_version][crate::client::ManagedSchemaRegistry::get_raw_schema_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetRawSchemaVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetRawSchemaVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetRawSchemaVersion(RequestBuilder<crate::model::GetVersionRequest>);

    impl GetRawSchemaVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .get_raw_schema_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetVersionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [deleted][crate::model::GetVersionRequest::deleted].
        pub fn set_deleted<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [deleted][crate::model::GetVersionRequest::deleted].
        pub fn set_or_clear_deleted<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetRawSchemaVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_versions][crate::client::ManagedSchemaRegistry::list_versions] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListVersions;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListVersions {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);

    impl ListVersions {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .list_versions(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [deleted][crate::model::ListVersionsRequest::deleted].
        pub fn set_deleted<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [deleted][crate::model::ListVersionsRequest::deleted].
        pub fn set_or_clear_deleted<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.deleted = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListVersions {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::create_version][crate::client::ManagedSchemaRegistry::create_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::CreateVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);

    impl CreateVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::CreateVersionResponse> {
            (*self.0.stub)
                .create_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [version][crate::model::CreateVersionRequest::version].
        pub fn set_version<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.version = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.version = v.map(|x| x.into());
            self
        }

        /// Sets the value of [id][crate::model::CreateVersionRequest::id].
        pub fn set_id<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.id = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [id][crate::model::CreateVersionRequest::id].
        pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.id = v.map(|x| x.into());
            self
        }

        /// Sets the value of [schema_type][crate::model::CreateVersionRequest::schema_type].
        pub fn set_schema_type<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::schema::SchemaType>,
        {
            self.0.request.schema_type = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [schema_type][crate::model::CreateVersionRequest::schema_type].
        pub fn set_or_clear_schema_type<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::schema::SchemaType>,
        {
            self.0.request.schema_type = v.map(|x| x.into());
            self
        }

        /// Sets the value of [schema][crate::model::CreateVersionRequest::schema].
        ///
        /// This is a **required** field for requests.
        pub fn set_schema<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.schema = v.into();
            self
        }

        /// Sets the value of [references][crate::model::CreateVersionRequest::references].
        pub fn set_references<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::schema::SchemaReference>,
        {
            use std::iter::Iterator;
            self.0.request.references = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [normalize][crate::model::CreateVersionRequest::normalize].
        pub fn set_normalize<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.normalize = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [normalize][crate::model::CreateVersionRequest::normalize].
        pub fn set_or_clear_normalize<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.normalize = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::delete_version][crate::client::ManagedSchemaRegistry::delete_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::DeleteVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);

    impl DeleteVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .delete_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [permanent][crate::model::DeleteVersionRequest::permanent].
        pub fn set_permanent<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.permanent = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [permanent][crate::model::DeleteVersionRequest::permanent].
        pub fn set_or_clear_permanent<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.permanent = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_referenced_schemas][crate::client::ManagedSchemaRegistry::list_referenced_schemas] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListReferencedSchemas;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListReferencedSchemas {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListReferencedSchemas(RequestBuilder<crate::model::ListReferencedSchemasRequest>);

    impl ListReferencedSchemas {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListReferencedSchemasRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<api::model::HttpBody> {
            (*self.0.stub)
                .list_referenced_schemas(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListReferencedSchemasRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListReferencedSchemas {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::check_compatibility][crate::client::ManagedSchemaRegistry::check_compatibility] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::CheckCompatibility;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CheckCompatibility {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CheckCompatibility(RequestBuilder<crate::model::CheckCompatibilityRequest>);

    impl CheckCompatibility {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CheckCompatibilityRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::CheckCompatibilityResponse> {
            (*self.0.stub)
                .check_compatibility(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::CheckCompatibilityRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [schema_type][crate::model::CheckCompatibilityRequest::schema_type].
        pub fn set_schema_type<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::schema::SchemaType>,
        {
            self.0.request.schema_type = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [schema_type][crate::model::CheckCompatibilityRequest::schema_type].
        pub fn set_or_clear_schema_type<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::schema::SchemaType>,
        {
            self.0.request.schema_type = v.map(|x| x.into());
            self
        }

        /// Sets the value of [schema][crate::model::CheckCompatibilityRequest::schema].
        ///
        /// This is a **required** field for requests.
        pub fn set_schema<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.schema = v.into();
            self
        }

        /// Sets the value of [references][crate::model::CheckCompatibilityRequest::references].
        pub fn set_references<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::schema::SchemaReference>,
        {
            use std::iter::Iterator;
            self.0.request.references = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [verbose][crate::model::CheckCompatibilityRequest::verbose].
        pub fn set_verbose<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.verbose = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [verbose][crate::model::CheckCompatibilityRequest::verbose].
        pub fn set_or_clear_verbose<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.verbose = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CheckCompatibility {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_schema_config][crate::client::ManagedSchemaRegistry::get_schema_config] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetSchemaConfig;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSchemaConfig {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSchemaConfig(RequestBuilder<crate::model::GetSchemaConfigRequest>);

    impl GetSchemaConfig {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetSchemaConfigRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaConfig> {
            (*self.0.stub)
                .get_schema_config(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetSchemaConfigRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [default_to_global][crate::model::GetSchemaConfigRequest::default_to_global].
        pub fn set_default_to_global<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.default_to_global = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [default_to_global][crate::model::GetSchemaConfigRequest::default_to_global].
        pub fn set_or_clear_default_to_global<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.default_to_global = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetSchemaConfig {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::update_schema_config][crate::client::ManagedSchemaRegistry::update_schema_config] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::UpdateSchemaConfig;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateSchemaConfig {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateSchemaConfig(RequestBuilder<crate::model::UpdateSchemaConfigRequest>);

    impl UpdateSchemaConfig {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateSchemaConfigRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaConfig> {
            (*self.0.stub)
                .update_schema_config(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::UpdateSchemaConfigRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [compatibility][crate::model::UpdateSchemaConfigRequest::compatibility].
        ///
        /// This is a **required** field for requests.
        pub fn set_compatibility<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::schema_config::CompatibilityType>,
        {
            self.0.request.compatibility = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [compatibility][crate::model::UpdateSchemaConfigRequest::compatibility].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_compatibility<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::schema_config::CompatibilityType>,
        {
            self.0.request.compatibility = v.map(|x| x.into());
            self
        }

        /// Sets the value of [normalize][crate::model::UpdateSchemaConfigRequest::normalize].
        pub fn set_normalize<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.normalize = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [normalize][crate::model::UpdateSchemaConfigRequest::normalize].
        pub fn set_or_clear_normalize<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.normalize = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateSchemaConfig {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::delete_schema_config][crate::client::ManagedSchemaRegistry::delete_schema_config] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::DeleteSchemaConfig;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteSchemaConfig {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteSchemaConfig(RequestBuilder<crate::model::DeleteSchemaConfigRequest>);

    impl DeleteSchemaConfig {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteSchemaConfigRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaConfig> {
            (*self.0.stub)
                .delete_schema_config(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteSchemaConfigRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteSchemaConfig {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_schema_mode][crate::client::ManagedSchemaRegistry::get_schema_mode] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetSchemaMode;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSchemaMode {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSchemaMode(RequestBuilder<crate::model::GetSchemaModeRequest>);

    impl GetSchemaMode {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetSchemaModeRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaMode> {
            (*self.0.stub)
                .get_schema_mode(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetSchemaModeRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetSchemaMode {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::update_schema_mode][crate::client::ManagedSchemaRegistry::update_schema_mode] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::UpdateSchemaMode;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateSchemaMode {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateSchemaMode(RequestBuilder<crate::model::UpdateSchemaModeRequest>);

    impl UpdateSchemaMode {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateSchemaModeRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaMode> {
            (*self.0.stub)
                .update_schema_mode(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::UpdateSchemaModeRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [mode][crate::model::UpdateSchemaModeRequest::mode].
        ///
        /// This is a **required** field for requests.
        pub fn set_mode<T: Into<crate::model::schema_mode::ModeType>>(mut self, v: T) -> Self {
            self.0.request.mode = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateSchemaMode {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::delete_schema_mode][crate::client::ManagedSchemaRegistry::delete_schema_mode] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::DeleteSchemaMode;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteSchemaMode {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteSchemaMode(RequestBuilder<crate::model::DeleteSchemaModeRequest>);

    impl DeleteSchemaMode {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteSchemaModeRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SchemaMode> {
            (*self.0.stub)
                .delete_schema_mode(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteSchemaModeRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteSchemaMode {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_locations][crate::client::ManagedSchemaRegistry::list_locations] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListLocations;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListLocations {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);

    impl ListLocations {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
            (*self.0.stub)
                .list_locations(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [name][location::model::ListLocationsRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListLocations {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_location][crate::client::ManagedSchemaRegistry::get_location] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetLocation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetLocation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);

    impl GetLocation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<location::model::Location> {
            (*self.0.stub)
                .get_location(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][location::model::GetLocationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetLocation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::list_operations][crate::client::ManagedSchemaRegistry::list_operations] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::ListOperations;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListOperations {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);

    impl ListOperations {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
            (*self.0.stub)
                .list_operations(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            longrunning::model::ListOperationsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.return_partial_success = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListOperations {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::get_operation][crate::client::ManagedSchemaRegistry::get_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::GetOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);

    impl GetOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .get_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::delete_operation][crate::client::ManagedSchemaRegistry::delete_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::DeleteOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);

    impl DeleteOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ManagedSchemaRegistry::cancel_operation][crate::client::ManagedSchemaRegistry::cancel_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_managedkafka_schemaregistry_v1::builder;
    /// use builder::managed_schema_registry::CancelOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CancelOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);

    impl CancelOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedSchemaRegistry>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .cancel_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CancelOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
